export const updateCountdown = (targetDate) => {
  if (!targetDate) {
    targetDate = new Date().getFullYear()
  }
  const targetTime = new Date(targetDate + '-12-31').getTime()
  const currentDate = new Date().getTime()
  const timeRemaining = targetTime - currentDate
  const days = Math.floor(timeRemaining / (1000 * 60 * 60 * 24))
  const hours = Math.floor((timeRemaining % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))
  const minutes = Math.floor((timeRemaining % (1000 * 60 * 60)) / (1000 * 60))
  const seconds = Math.floor((timeRemaining % (1000 * 60)) / 1000)

  return [days, hours, minutes, seconds]
}

export const getImgName = (imagePath) => {
  // const imagePath = 'http://admin.umayle.com/upload/userphoto/郑亚丽.jpg' // 假设这是图片路径
  return imagePath.split('/').pop()
}
